<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript">
function lottoCheck(){
	var number1 = document.lottoForm.number1.value;
	var number2 = document.lottoForm.number2.value;
	var number3 = document.lottoForm.number3.value;
	var number4 = document.lottoForm.number4.value;
	var number5 = document.lottoForm.number5.value;
	var number6 = document.lottoForm.number6.value;
	 
	if(number1==""){
		alert("첫번째 숫자를 입력해 주세요.");
		return false;
	}
	if(number2==""){
		alert("두번째 숫자를 입력해 주세요.");
		return false;
	}
	if(number3==""){
		alert("세번째 숫자를 입력해 주세요.");
		return false;
	}
	if(number4==""){
		alert("네번째 숫자를 입력해 주세요.");
		return false;
	}
	if(number5==""){
		alert("다섯번째 숫자를 입력해 주세요.");
		return false;
	}
	if(number6==""){
		alert("여섯번째 숫자를 입력해 주세요.");
		return false;
	}
	
	var cnt=0;
	var lottoInputNumber = [number1,number2,number3,number4,number5,number6];
	 
	for(var i=0;i<6;i++){
		for(var j=0;j<6;j++){
			if(i!=j){
				if(lottoInputNumber[i]==lottoInputNumber[j]){
					alert("서로 다른 숫자를 입력해 주세요.");
					return false;
				}
			}
		}
			
	}
	
}
</script>
<body>
<form action="/${initParam.context_root }/event.do" onsubmit="return lottoCheck()" name="lottoForm">
<br>
<b>* 이벤트(로또)</b><hr><br>
<font color="red">맞추는 만큼 point를 적립해 드립니다.</font><br>
<table border="1" cellpadding="10" cellspacing="0">
<tr bgcolor="#afeeee">
	<td><b>로또 - 숫자를 입력하세요(1~45)</b></td>
</tr>
<tr>
	<td>
		<input type="text" name="number1" size="2" maxlength="2">
		<input type="text" name="number2" size="2" maxlength="2">
		<input type="text" name="number3" size="2" maxlength="2">
		<input type="text" name="number4" size="2" maxlength="2">
		<input type="text" name="number5" size="2" maxlength="2">
		<input type="text" name="number6" size="2" maxlength="2">
	</td>
</tr>
<tr>
	<td align="center"><input type="submit" value="정답확인"><input type="reset" value="초기화"></td>
</tr>
</table>
</form>
